export const config = {
  // 服务器配置
  server: {
    port: process.env.PORT || 3000,
    host: process.env.HOST || 'localhost',
    env: process.env.NODE_ENV || 'development'
  },

  // MySQL配置
  mysql: {
    host: process.env.MYSQL_HOST || '113.45.130.158',
    port: parseInt(process.env.MYSQL_PORT) || 3306,
    database: process.env.MYSQL_DATABASE || 'foot-ball',
    username: process.env.MYSQL_USERNAME || 'foot-ball',
    password: process.env.MYSQL_PASSWORD || 'zhoupeng0abc'
  },
  // 日志配置
  logger: {
    level: process.env.LOG_LEVEL || 'info',
    filename: 'logs/app-%DATE%.log',
    datePattern: 'YYYY-MM-DD',
    maxFiles: '14d'
  },

  // 缓存配置
  cache: {
    ttl: 60 * 5, // 5分钟
    checkperiod: 60 // 1分钟
  },

  // CORS配置
  cors: {
    origin: process.env.CORS_ORIGIN || '*',
    methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
    allowedHeaders: ['Content-Type', 'Authorization']
  },

  // 安全配置
  security: {
    rateLimit: {
      windowMs: 15 * 60 * 1000, // 15分钟
      max: 100 // 限制100次请求
    },
    helmet: {
      contentSecurityPolicy: false
    }
  }
}; 